﻿#include "stdafx.h"
#include <string.h>
#include <stdlib.h>
#include <time.h>
#include <stdio.h>
#include <string.h>

#include "SWidget.h"
#include "ComAPI.h"
#include "apptypedef.h"
#include "sysarch.h"
#include "sysapi.h"
#include "sysfs.h"
#include "GUI.H"
#include "MenuIf.h"

s32 Dummy(void *var)
{
    return -1;
}

struct ListBoxItemStruct tmMainMenu[] =
{
    { (s8*)"测试数据", 0xFF, Dummy, NULL },
	 { (s8*)"12 测试数据", 0xFF, Dummy, NULL },
	 { (s8*)"12 测试数据", 0xFF, Dummy, NULL },
	 { (s8*)"12 测试数据", 0xFF, Dummy, NULL },
	 { (s8*)"测试数据", 0xFF, Dummy, NULL },
    { NULL, 0xFF, NULL, NULL },
};
extern OS_SEM g_SemGUI;


TThreadRet DisplayThread(void* pvArg)
{
    TTime tmLast;


    Debug(DEBUG_CRITICAL, ("DisplayThread: Version V1.00!\r\n"));

    g_SemGUI = OSSemCreate(1);

    Sleep(5000);

    Debug(DEBUG_CRITICAL, ("DisplayThread: start!\r\n"));
    //g_Key.Init();

    Debug(DEBUG_CRITICAL, ("DisplayThread: GUI_Init!\r\n"));

    GUI_Init();

    GetCurTime(&tmLast);    
    CMyListBox ListBox;
    //clear_screen_rec(0, LCD_GetFontHeight(), LCD_SIM_WIDTH, LCD_SIM_HEIGHT - LCD_GetFontHeight());

        
        while (1)
        {
        	 //Debug(DEBUG_CRITICAL, ("DisplayThread: ListBox run!\r\n"));
             ListBox.Run(0, (s8*)"主菜单", tmMainMenu, KEY_ESC, 60000);
        }

        Debug(DEBUG_CRITICAL, ("###DisplayThread: exit!\r\n"));
        return THREAD_RET_OK;
   
}
